﻿@model wh40klbWeb.Models.InfantryViewModel
@{
    ViewBag.Title = "Create";
}
<h2>
    Create</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    @Html.HiddenFor(mod=>mod.Army.Id)
    <fieldset>
        <legend>InfantryViewModel</legend>
        <table>
            <thead>
                <tr>
                    <th>
                        Nom
                    </th>
                    <th>
                        CC
                    </th>
                    <th>
                        CT
                    </th>
                    <th>
                        Force
                    </th>
                    <th>
                        Endurance
                    </th>
                    <th>
                        PV
                    </th>
                    <th>
                        Initiative
                    </th>
                    <th>
                        Attaque
                    </th>
                    <th>
                        Cmd
                    </th>
                    <th>
                        Sauvegarde
                    </th>
                    <th>
                        type d'escouade
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <div class="editor-field">
                            @Html.TextBoxFor(model => model.Name)
                            @Html.ValidationMessageFor(model => model.Name)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.WeaponSkill)
                            @Html.ValidationMessageFor(model => model.WeaponSkill)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.BallisticSkill)
                            @Html.ValidationMessageFor(model => model.BallisticSkill)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Strengh)
                            @Html.ValidationMessageFor(model => model.Strengh)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Thoughness)
                            @Html.ValidationMessageFor(model => model.Thoughness)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Wounds)
                            @Html.ValidationMessageFor(model => model.Wounds)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Initiative)
                            @Html.ValidationMessageFor(model => model.Initiative)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Attack)
                            @Html.ValidationMessageFor(model => model.Attack)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Leadership)
                            @Html.ValidationMessageFor(model => model.Leadership)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.ArmorSave)
                            @Html.ValidationMessageFor(model => model.ArmorSave)
                        </div>
                    </td>
                    <td>
                        @Html.DropDownListFor(model => model.SquadTypeSelected, new SelectList(Model.SquadTypes,"Id","Name"))
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <table>
            <thead>
                <tr>
                    <th>
                        Nom
                    </th>
                    <th>
                        Descritpion
                    </th>
                    <th>
                        Sélectionné ?
                    </th>
                </tr>
            </thead>
            <tbody>
                @Html.EditorFor(model => model.SpecialRules)
            </tbody>
        </table>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
    if (ViewBag.Erreur != null)
    {
        Html.Display((string)ViewBag.Erreur);
    }
}
<div>
    @Html.ActionLink("retour a l'armée", "Details", "Army", new {id=Model.Army.Id }, null)
</div>
